package StrategyMode.version3;

import StrategyMode.version2.CollectingSilver;

import java.util.ArrayList;
import java.util.Scanner;

/**
 * Created by ycq on 2018/10/17.
 */
public class Main {

    public static void main(String[] args) {
        Double total=0d;
        btnOk_Click(total);
    }


    private static void btnOk_Click(Double total) {
        while (true) {
            Scanner in = new Scanner(System.in);
            String Mode = Form1_load();
            CashSuper csuper = CashFactory.createCashAccept(Mode);
            Double totalPrices = 0d;
            System.out.println("输入单价");
            Double txtPrice = in.nextDouble();
            System.out.println("输入数量");
            Double txtNum = in.nextDouble();
            totalPrices = csuper.acceptCash(txtPrice * txtNum);
            total = total + totalPrices;
            System.out.println("单价:" + txtPrice + " 数量:" + txtNum + " 合计:" + totalPrices);
            System.out.println("总计：" + total);
        }
    }
    private static  String  Form1_load(){
        Scanner in =new Scanner(System.in);
        ArrayList arrayList=new ArrayList();
        arrayList.add("正常");
        arrayList.add("满减");
        arrayList.add("打折");
        System.out.println(arrayList);
        System.out.println("请输入以上字符");
        return in.next();
    }
}
